#多态，多种形态
class Animal:
    def speak(self):
        print("动物叫，但不知道是哪种动物")

class Dog(Animal):
    def speak(self):
        print("小狗叫，汪汪")

class Cat(Animal):
    def speak(self):
        print("小猫叫，喵喵")

class Car:
    def speak(self):
        print("汽车叫，滴滴")

class Child:
    def speak(self):
        print("小孩叫，哇哇")

#obj对象只要具有speak的方法，都可以往里传，虽然都叫做speak但是结果却千差万别
def start_speak(obj):
    obj.speak()
    #相当于Cat().speak

xiaomao=Cat()
start_speak(xiaomao)
xiaoqiche=Car()
start_speak(xiaoqiche)